Telegram Group & Telegram Channel
⚡️ Команда дня: std::string_view

Работа со строками часто сопровождается лишними копированиями при передаче в функции, что негативно влияет на производительность.

std::string_view — невладеющее представление последовательности символов, которое избавляет от ненужных копирований строк.


🔴 До:

bool startsWith(const std::string& str, const std::string& prefix) {
return str.substr(0, prefix.length()) == prefix;
}



🟢 После:

bool startsWith(std::string_view str, std::string_view prefix) {
return str.substr(0, prefix.length()) == prefix;
}



❗️Примеры использования:

• Функции, принимающие строки для чтения
• Парсинг строк без копирования
• Работа с подстроками без создания новых объектов std::string


💡 Заменили уже const std::string& на std::string_view в своем коде?

Библиотека C/C++ разработчика #буст



tg-me.com/cppproglib/5764
Create:
Last Update:

⚡️ Команда дня: std::string_view

Работа со строками часто сопровождается лишними копированиями при передаче в функции, что негативно влияет на производительность.

std::string_view — невладеющее представление последовательности символов, которое избавляет от ненужных копирований строк.


🔴 До:

bool startsWith(const std::string& str, const std::string& prefix) {
return str.substr(0, prefix.length()) == prefix;
}



🟢 После:

bool startsWith(std::string_view str, std::string_view prefix) {
return str.substr(0, prefix.length()) == prefix;
}



❗️Примеры использования:

• Функции, принимающие строки для чтения
• Парсинг строк без копирования
• Работа с подстроками без создания новых объектов std::string


💡 Заменили уже const std::string& на std::string_view в своем коде?

Библиотека C/C++ разработчика #буст

BY Библиотека C/C++ разработчика | cpp, boost, qt


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/cppproglib/5764

View MORE
Open in Telegram


Библиотека C C разработчика | cpp boost qt Telegram | DID YOU KNOW?

Date: |

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

How To Find Channels On Telegram?

There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.

Библиотека C C разработчика | cpp boost qt from es


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM USA